package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.wx.vo.CategoryCurrentVO;
import com.cskaoyan.bean.wx.vo.CategoryIndexVO;
import com.cskaoyan.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Jcy
 * 类目
 */
@RestController
@RequestMapping("wx/catalog")
public class CatalogController {

    @Autowired
    CategoryService categoryService;

    @RequestMapping("index")
    public BaseRespVo index(){
        CategoryIndexVO data = categoryService.index();
        return BaseRespVo.ok(data);
    }

    @RequestMapping("current")
    public BaseRespVo current(Integer id){
        CategoryCurrentVO data = categoryService.current(id);
        return BaseRespVo.ok(data);
    }
}
